/** @jsxImportSource @emotion/react */
import * as React from "react";
import {CCell, Cell, Table, TableBody, TableRow, Text,} from "customize-easy-ui-component";
import {RepLink} from "../../common/base";
import {config安全附件, } from "./editSAcces";
import {TailMenRowIspCheck} from "../../contain/rarelyVary";
import {usePrefixDataTable} from "../../hook/usePrefixData";


export const 安全附件检验= ({theme, orc, rep} :{theme: any, orc:any, rep:any}
) => {
  const renderUpper=usePrefixDataTable({config: config安全附件, orc, rep, slash:true});
  //const [renderPress]=useOmnipotentPref({orc, config:item附件压力, tailRender, pcols:2, noNo:true, unitCel:false,xmcol:2});
  return <>
    <div css={{"@media print": {paddingBottom: '3.5rem', pageBreakInside: 'avoid'}} }>
      <Text id='SafetyAccesor' variant="h2" css={{textAlign: 'center', marginTop: '1rem',
      }}>安全附件检验报告</Text>
      <div css={{display: 'flex', justifyContent: 'space-between'}}>
        <Text>单位内部编号：{orc.单位内部编号}</Text>
        <Text>报告编号：{rep.isp.no}</Text>
      </div>
    </div>
    <Table fixed={ ["5.5%","9%","%","7%","5.2%","40%"] } css={{borderCollapse: 'collapse', "@media print": {marginTop: '-3.5rem'}}} tight  miniw={800}>
      <TableBody>
        <RepLink rep={rep} tag={'SafetyAccesor'}>
          { renderUpper }
          <TableRow>
            <CCell rowSpan={2}><Text css={{fontSize: '0.75rem'}}>快开门式压力容器安全联锁装置</Text></CCell><Cell colSpan={5}>使用环境、校验周期、校验方法是否符合设计要求:</Cell>
          </TableRow>
          <TableRow>
            <Cell colSpan={5}><div css={{minHeight: '1rem',whiteSpace:'pre-wrap',paddingLeft:'0.2rem'
            }}>{orc.快开联锁??'／'}</div></Cell>
          </TableRow>
          <TableRow>
            <Cell colSpan={6}><div css={{minHeight: '3rem',whiteSpace:'pre-wrap'
            }}>其他阀门、附件检验：<br/>
              {orc.其他阀检??'／'}</div></Cell>
          </TableRow>
          <TableRow>
            <Cell colSpan={6}><div css={{minHeight: '2rem',whiteSpace:'pre-wrap'
            }}>备注：<br/>
              {orc.安附备注??'／'}</div></Cell>
          </TableRow>
          <TableRow>
            <Cell colSpan={6}><div css={{minHeight: '2rem',whiteSpace:'pre-wrap'
            }}>检查结果：<br/>
              {orc.安附结果??'／'}</div></Cell>
          </TableRow>
        </RepLink>
      </TableBody>
    </Table>
    <TailMenRowIspCheck orc={orc} rep={rep} href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/ProjectList#ProjectList`}>
    </TailMenRowIspCheck>
  </>;
};
